export const formatDate = (date) => {
  if (typeof (date) === 'string') {
    date = new Date(date)
  }
  let m = date.getMonth() + 1
  m = m > 9 ? m : ('0' + m)
  return `${date.getFullYear()}-${m}-${date.getDate()}`
}
